package homelesspartners.client.model;

import java.io.Serializable;


public class Gift implements Serializable{

	private static final long serialVersionUID = 1L;

	private static final String SPACE = " ";
	private int id = -1;
	private String description = null;
	private boolean pledged = false;
	private Story story = null;
	private String donor = null;
	
	public String getDescription() {
		return description;
	}
	
	public String toString() {
		StringBuffer buffer = new StringBuffer();
		buffer.append(id);
		buffer.append(SPACE);
		buffer.append(description);
		buffer.append(SPACE);
		buffer.append(pledged);
		buffer.append(SPACE);
		buffer.append(story.getId());
		return buffer.toString();
	}

	public void setDescription(String aDescription) {
		description = aDescription;
	}
	
	public int getId() {
		return id;
	}
	
	public void setId(int anId) {
		id = anId;
	}
	
	public boolean isPledged() {
		if(donor != null){
			return true;
		}
		return false;
	}
	
	
	public String getDonor() {
		return donor;
	}

	
	public void setDonor(String donor) {
		this.donor = donor;
	}

	public Story getStory() {
		return story;
	}
	
	public void setStory(Story aStory){
		story = aStory;
	}
	
	public boolean equals(Object obj) {
		Gift compared = (Gift) obj;
		if(this.getId() == compared.getId()) {
			return true;
		}
		return false;
	}
	
}
